#include <stdio.h>

double avgScore(int *arr, int size);
 
int main(void){
    int scores[]={70,80,90,95,91};
    double avg = avgScore(scores,sizeof(scores)/sizeof(scores[0]));
    printf("avg=%.2lf\n",avg);
    return 0;
}
double avgScore(int *arr, int size){
    int sum=0;
    double avg=0;    

    for(int i=0;i<size;i++){
        sum+=*arr;// 累加数组每个元素的值
        arr++;
    }
    avg = (double)sum/size;
    return avg;
}